package com.aichongbang.acb.service.impl;

import com.aichongbang.acb.po.ServiceOrder;
import com.aichongbang.acb.mapper.ServiceOrderMapper;
import com.aichongbang.acb.service.IServiceOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author acb
 * @since 2021-05-27
 */
@Service("serviceOrderService")
public class ServiceOrderServiceImpl extends ServiceImpl<ServiceOrderMapper, ServiceOrder> implements IServiceOrderService {

    @Resource
    private ServiceOrderMapper serviceOrderMapper;


    @Override
    public List<ServiceOrder> getAllServiceOrders() {
        List<ServiceOrder> list = serviceOrderMapper.getAllServiceOrders();
        return list;
    }

    @Override
    public List<ServiceOrder> queryServiceOrders(ServiceOrder serviceOrder) {
        List<ServiceOrder> list = serviceOrderMapper.queryServiceOrders(serviceOrder);
        return list;
    }

    @Override
    public ServiceOrder getServiceOrderById(Integer tId) {
        return serviceOrderMapper.getServiceOrderById(tId);
    }

    @Override
    public boolean updateServiceOrder(ServiceOrder serviceOrder) {
        int n = serviceOrderMapper.updateById(serviceOrder);
        return n > 0 ? true : false;
    }

    @Override
    public boolean deletedServiceOrder(Integer tId) {
        int n = serviceOrderMapper.deleteById(tId);
        return n > 0 ? true : false;
    }
}
